fix placement of placeholder text in QLineEdits with action icons
authorDebian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Thu, 23 Sep 2021 13:02:33 +0000 (14:02 +0100)
committerLisandro Damián Nicanor Pérez Meyer <lisandro@debian.org>
Thu, 23 Sep 2021 13:02:33 +0000 (14:02 +0100)
commitc04911f3622cdbb98fd240c90ecb3f39869daa47
treea4c3781100255d79157f02f662562590335396b6
parent3e829b1b89a5f012953aa797127e678396eb389f
fix placement of placeholder text in QLineEdits with action icons

Origin: upstream, https://code.qt.io/cgit/qt/qtbase.git/commit/?id=0e6b31019f01c72e
Last-Update: 2021-08-10

After dc794f7622bc00f7ca50fab65d6965695d6d2972, side widgets only got
space if they were not fading out, but the logic was not correctly
accounting for side widgets that never fade, such as buttons added via
QLineEdit::addAction.

Fix this to give visible widgets space, unless they are fading out. That
was the intent of the original change. Rename the variable to make its
purpose clearer, and reset it at the end of the fade-out animation.

Add a much-needed test that relies on private APIs to verify that the
effective margins are calculated correctly.

Gbp-Pq: Name fix-placement-of-placeholder-text-in-QLineEdits-with-action-icons.diff
src/widgets/widgets/qlineedit_p.cpp
src/widgets/widgets/qlineedit_p.h
tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp